part of '../index.dart';

class _Dialog extends StatelessWidget {
  const _Dialog(this.conversationId, {super.key});
  final String? conversationId;

  @override
  Widget build(BuildContext context) {
    return Dialog(
      backgroundColor: Colors.white,
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(8),
      ),
      child: Padding(
        padding: const EdgeInsets.only(top: 17),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Text(
              T.current.c_remove_conv,
              style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
            ),
            Padding(
              padding: const EdgeInsets.only(bottom: 15, top: 8),
              child: Text(
                T.current.c_remove_conv_tips,
                style: const TextStyle(color: Color(0xFFA8A8A8), fontSize: 12),
              ),
            ),
            const Divider(height: 0, color: Color(0xFFF2F2F2)),
            Row(
              children: [
                Expanded(
                  child: GestureDetector(
                    onTap: () => Navigator.pop(context),
                    child: Text(
                      T.current.c_common_cancel,
                      textAlign: TextAlign.center,
                      style: const TextStyle(
                          color: Color(0xFFC1C1C1), fontSize: 16),
                    ),
                  ),
                ),
                Container(width: 1, height: 45, color: const Color(0xFFF2F2F2)),
                Expanded(
                  child: GestureDetector(
                    onTap: () {
                      Navigator.pop(context);
                      ImManager.of.deleteConversation(conversationId);
                    },
                    child: Text(
                      T.current.c_common_confirm,
                      textAlign: TextAlign.center,
                      style: const TextStyle(color: Colors.black, fontSize: 16),
                    ),
                  ),
                ),
              ],
            )
          ],
        ),
      ),
    );
  }
}
